JDBC (Java Data Base Connectivity)

   Using JDBC jars we can establish connection to DB & perform the DB operations.
It is an application programming interface (API) for the programming language Java, which defines how a client may access a database.


Steps to configure JDBC jars:
1. Go to Oracle website & download the jdbc jars
    => following jars you have to download fom oracle website
	ojdbc5.jar
	ojdbc6.jar
	ojdbc6_g.jar
	
   OR
   
   go to the client installation path in your local PC & navigate to jdbc dir & copy the jar files.
  EX: C:\oraclexe\app\oracle\product\11.2.0\server\jdbc\lib

2. All the jdbc jars should be put in eclipse std folder structure

3. Set the build path for all the jar files
------------------------------------------


Steps to implement the JDBC connection (Object Model):

1. Establish a connection using 'Connection' interface & provide the appropriate connection string (DB address)

2. Execute query using 'Statement' OR 'PreparedStatement' interfaces.

3. Use 'ResultSet' interface to store the query output.

4. Use 'ResultSetMetaData' interface to get the table meta data

5. Close the connection & release the objects





Q: Difference between Statemet & PreparedStatement
Ans:
1. It is used to execute normal SQL queries with no parameter.
1. It is used to execute parameterized or dynamic SQL queries.

2. Statemet interface object doesnot accept query as input
2. PreparedStatement interface object accepts query as input

3. The performance of this interface is very low
3. The performance of this interface is better than the Statement interface (when used for multiple execution of same query).

4. This interface is mainly used for DDL statements like CREATE, ALTER, DROP etc
4. It is used for any kind of SQL queries which are to be executed multiple times.

